package com.gxa.autoparts.admin.service.impl;

import com.gxa.autoparts.admin.mapper.AfterSaleMapper;
import com.gxa.autoparts.admin.mapper.ArticleMapper;
import com.gxa.autoparts.admin.service.AfterSaleService;
import com.gxa.autoparts.admin.service.ArticleService;
import com.gxa.autoparts.core.pojo.AfterSale;
import com.gxa.autoparts.core.pojo.Article;
import com.gxa.autoparts.core.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Bei
 * @date 2022/1/6 9:58
 */
@Service
@Transactional(rollbackFor = Throwable.class)
public class AfterSaleServiceImpl extends BaseServiceImpl<AfterSale> implements AfterSaleService {

    @Autowired
    AfterSaleMapper afterSaleMapper;

    @Override
    public List<Map> afterSale(Integer page, Integer size) {
        afterSaleMapper.init();
        List<Map> maps = afterSaleMapper.afterSale((page-1)*size,size);
        return maps;
    }

    @Override
    public List<String> afterSaleImg(Long id) {
        List<String> list = afterSaleMapper.afterSaleImg(id);
        return list;
    }

    @Override
    public List<Map> afterSaleByLike(String sid, String name, String phone, Integer page, Integer size) {
        List<Map> maps = afterSaleMapper.afterSaleByLike(sid, name, phone, (page - 1) * size, size);
        return maps;
    }
}
